<template>
  <div>
    <!-- 侧边导航 -->
    <wSidebar></wSidebar>
    <!-- 主体内容 isOpen-控制是否展示二级导航 -->
    <div class="wHome-main" :class="{ isOpen: collapse }">
      <transition name="fade" :appear="true" mode="out-in">
        <router-view></router-view>
      </transition>
    </div>
  </div>
</template>

<script>
import wSidebar from "@/components/public/Sidebar.vue";
export default {
  components: {
    wSidebar,
  },
  data() {
    return {};
  },
  computed: {
    // 侧边栏是否关闭
    collapse() {
      return this.$store.state.sidebarClassB;
    },
  },
};
</script>

<style lang="less" scoped>
@import "@/assets/css/publicStyle.less";

// 主体内容
.wHome-main {
  position: fixed;
  top: 0;
  left: @wWidth_sidebar_c;
  right: 0;
  bottom: 0;
  z-index: 10;
  background-color: @wColor_bg;
  transition: all 0.3s;

  &.isOpen {
    left: @wWidth_sidebar_o;
    transition: all 0.3s;
  }
}
</style>
